
#ifndef _CUSTOMERRECORD_H_20111127
#define _CUSTOMERRECORD_H_20111127

#include <string>
#include "Record.h"
#include "TimeDate.h"

namespace AirlineRes
{

/// Class to store and operate upon the data that comprises a customer.
class CustomerRecord : public Record
{
public:
  CustomerRecord(){};
  ~CustomerRecord(){};

  /// Construct record initialised with field values.
  CustomerRecord
    (
      std::string const&  _passportNo,
      std::string const&  _firstName,
      std::string const&  _lastName,
      TimeDate    const&  _dateOfBirth,
      std::string const&  _email,
      std::string const&  _phoneNo
    );

  virtual RecordIOResult LoadRecord( std::istream& _stream );
  virtual RecordIOResult WriteRecord( std::ostream& _stream ) const;

  // Getters

  /// @return  Passport number of customer.
  inline std::string GetPassportNo() const { return m_passportNo; };
  /// @return  First name of customer.
  inline std::string GetFirstName() const { return m_firstName; };
  /// @return  Last name of customer.
  inline std::string GetLastName() const { return m_lastName; };
  /// @return  TimeDate object representing customer's date of birth.
  inline TimeDate    GetDateOfBirth() const { return m_dateOfBirth; };
  /// @return  Email address of the customer.
  inline std::string GetEmail() const { return m_email; };
  /// @return  Phone number of the customer.
  inline std::string GetPhoneNo() const { return m_phoneNo; };

  // Setters
  /// Set the passport number.
  inline void SetPassportNo( std::string const& _passportNo )   { m_passportNo  = _passportNo;  };
  /// Set the first name.
  inline void SetFirstName( std::string const& _firstName )     { m_firstName   = _firstName;   };
  /// Set the last name.
  inline void SetLastName( std::string const& _lastName )       { m_lastName    = _lastName;    };
  /// Set the date of birth.
  inline void SetDateOfBirth( TimeDate const& _dateOfBirth )    { m_dateOfBirth = _dateOfBirth; };
  /// Set the email address.
  inline void SetEmail( std::string const& _email )             { m_email       = _email;       };
  /// Set the phone number.
  inline void SetPhoneNo( std::string const& _phoneNo )         { m_phoneNo     = _phoneNo;     };
private:
  std::string  m_passportNo;
  std::string  m_firstName;
  std::string  m_lastName;
  TimeDate     m_dateOfBirth;
  std::string  m_email;
  std::string  m_phoneNo;
};

}
#endif _CUSTOMERRECORD_H_20111127
